import React from "react";

interface ControlState {
  value: string
}

export default class Control extends React.Component {
  state: ControlState = { value: "0" }

  handleChange = (e:React.ChangeEvent<HTMLInputElement>) => {
    const value = e.target.value
    this.setState({ value })
  }

  render(): React.ReactNode {
    return (
      <>
        <input type="text" value={this.state.value} onChange={this.handleChange} />
        <h1>输入的值： { this.state.value }</h1>
      </>
    )
  }
}
